import request from '@/utils/request'

// 获取标签
export const getChannels = () => request('/user/channels')
// 获取分类数据
export const getArticles = (data) =>
  request(
    `/articles?channel_id=${data.channel_id}&with_top=${data.with_top}&timestamp=${data.timestamp}`
  )
// 获取详情内容
export const getDetailData = (id) => request('/articles/' + id)
// 获取评论
export const getConmment = (params) => {
  return request({
    method: 'get',
    url: '/comments',
    params,
  })
}
export const publish = (data) => {
  return request.post('/comments', data)
}
// 添加关注
export const followed = (data) => request.post('/user/followings', data)
// 取消关注
export const unfollow = (id) => request.delete(`/user/followings/${id}`)
